<script lang="ts" setup>
import { useSlots } from 'vue';

const slots = useSlots();

const props = withDefaults(defineProps<{ background?: string }>(), {
  background: '#ffffff',
});
</script>

<template>
  <van-sticky>
    <van-nav-bar
      left-arrow
      v-bind="$attrs"
      :border="false"
      :style="{ background: props.background }"
    >
      <template v-if="slots.right" #right>
        <slot name="right"></slot>
      </template>
    </van-nav-bar>

    <slot name="default"></slot>
  </van-sticky>
</template>

<style lang="scss" scoped></style>
